# -*- coding:utf-8 -*-
import os,logging


class Settings:
    # flask
    ENV = 'development'
    DEBUG = True
    SECRET_KEY = 'secret key is here'
    TEMPLATES_AUTO_RELOAD = True

    # sqlite
    base_dir = os.path.abspath(os.path.dirname(__file__))
    SQLALCHEMY_DATABASE_URI: str = 'sqlite:///' + os.path.join(base_dir, 'data.db')

    # mysql
    # SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:root@127.0.0.1:3306/alex_blog'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SQLALCHEMY_ECHO = True

    # logging
    LOGGING_LEVEL = logging.DEBUG
    LOGGING_FILE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),'logs/log')
    LOGGING_FILE_MAX_BYTES = 1024 * 1024 * 10
    LOGGING_FILE_BACKUP = 100
    LOGGING_FORMATTER = '%(levelname)s %(asctime)s [%(filename)s]: %(lineno)s - %(funcName)s - %(message)s'
